<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/echarts/4.2.1/echarts-en.common.js"></script>
</head>
<body>
<!-- 为ECharts准备一个具备大小（宽高）的Dom -->
<div id="main" style="width: 600px;height:400px;"></div>
<script type="text/javascript">
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('main'));

    $.get('http://localhost:8080/air1m20191001B/103/all', function (data) {
        myChart.setOption(option = {
            title: {
                text: 'Beijing CO'
            },
            tooltip: {
                trigger: 'axis'
            },
            xAxis: {
                data: data.map(function (item) {
                    return item[0];
                })
            },
            yAxis: {
                splitLine: {
                    show: false
                }
            },
            toolbox: {
                left: 'center',
                feature: {
                    dataZoom: {
                        yAxisIndex: 'none'
                    },
                    restore: {},
                    saveAsImage: {}
                }
            },
            dataZoom: [{
                startValue: '22:35'
            }, {
                type: 'inside'
            }],
            visualMap: {
                top: 10,
                right: 10,
                pieces: [{
                    gt: 0,
                    lte: 200,
                    color: '#096'
                }, {
                    gt: 200,
                    lte: 400,
                    color: '#ffde33'
                }, {
                    gt: 400,
                    lte: 600,
                    color: '#ff9933'
                }, {
                    gt: 600,
                    lte: 800,
                    color: '#cc0033'
                }, {
                    gt: 800,
                    lte: 1000,
                    color: '#660099'
                }, {
                    gt: 1000,
                    color: '#7e0023'
                }],
                outOfRange: {
                    color: '#999'
                }
            },
            series: {
                name: 'Beijing CO',
                type: 'line',
                data: data.map(function (item) {
                    return item[1];
                }),
                markLine: {
                    silent: true,
                    data: [{
                        yAxis: 200
                    }, {
                        yAxis: 400
                    }, {
                        yAxis: 650
                    }, {
                        yAxis: 800
                    }, {
                        yAxis: 1000
                    }]
                }
            }
        });
    });
</script>
</body>
</html>